//
//  YHYJobCollectionCell.m
//  Home
//
//  Created by 杨泓晔 on 16/4/19.
//  Copyright © 2016年 LanJue. All rights reserved.
//

#import "YHYJobCollectionCell.h"

@implementation YHYJobCollectionCell


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
      // if (_num == 1) {
            [self createSubView];
//        }
//        if (_num == 2) {
//            [self creatView];
//        }
    }
    return self;
}

- (void)setNum:(NSInteger)num{
       if (num == 2) {
        [self creatView];
    }
}

- (void)creatView{
    _image  = [UIImageView new];
    [self addSubview:_image];
    _image.image = [UIImage imageNamed:@"celladd"];
   // _image.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, self.frame.size.width, self.frame.size.height);
    [_image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self);
        make.height.width.mas_equalTo(self);
        make.left.mas_equalTo(self);
        
    }];
   

}

- (void)createSubView{
    
    _myLabel = [UILabel new];
    _myLabel.userInteractionEnabled = YES;
   // self.contentView.userInteractionEnabled = YES;
    _myLabel.textColor = ZI;
    _myLabel.layer.masksToBounds = YES;
    _myLabel.layer.borderColor = KH.CGColor;
    _myLabel.layer.borderWidth = 1.0;
     _myLabel.layer.cornerRadius = 8 * AUTO_WIDTH;
    _myLabel.textAlignment = NSTextAlignmentCenter;
    _myLabel.font = [UIFont fontWithName:TFont size:LOGINFONT * AUTO_WIDTH];
  //  self.contentView.backgroundColor = LV;
    [self.contentView addSubview:_myLabel];
    [_myLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.width.height.mas_equalTo(self);
        make.left.mas_equalTo(self);
        
    }];
    
}

- (void)setContentStr:(NSString *)contentStr {
    
    _contentStr = contentStr;
    self.myLabel.text = _contentStr;
}


- (void)changeColor:(BOOL)isChange {
    if (isChange) {
        [UIView animateWithDuration:0.3 animations:^{
      //  UIView *view = [self.myLabel.subviews objectAtIndex:1];
        //    view.backgroundColor = [UIColor blackColor]
            self.myLabel.backgroundColor = GH;
            self.myLabel.textColor = [UIColor whiteColor];
        }];
    }
    else {
        self.myLabel.backgroundColor = LV;
        _myLabel.textColor = ZI;
    }

    
    
}

//- (void)changeBorderColor:(BOOL)isChange {
//    
//    if (isChange) {
//        self.contentView.layer.borderColor = [UIColor redColor].CGColor;
//    }
//    else {
//        self.contentView.layer.borderColor = [UIColor clearColor].CGColor;
//    }
//}

//- (void)setPickModel:(YHYPickModel *)pickModel{
//    _pickModel = pickModel;
//    
//    
//}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
